﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using olierFrm.DataBase.FrameWork.Plugin;

namespace olierFrm.DataBase.FrameWork.StdQuery
{
public     class InChart
    {
        public class InChartEntity
        {
            public string ChartType
            {
                get;
                set;
            }
            public string Field_X
            {
                get;
                set;
            }
            public string Field_Y
            {
                get;
                set;
            }
            public string Caption_X
            {
                get;
                set;
            }
            public string Caption_Y
            {
                get;
                set;
            }
            public string ToolBox
            {
                get;
                set;
            }
            public string HomePage
            {
                get;
                set;
            }
            public string OnlyShowMe
            {
                get;
                set;
            }
            public string VisibleItem
            {
                get;
                set;
            }
        }
        private Dictionary<string, InChart.InChartEntity> _SciptObject = new Dictionary<string, InChart.InChartEntity>();
        public Dictionary<string, InChart.InChartEntity> SciptObject
        {
            get
            {
                return this._SciptObject;
            }
            set
            {
                this._SciptObject = value;
            }
        }
        public InChart(string inChart)
        {
            Dictionary<string, Dictionary<string, string>> sqs = SmartINI.LoadIni(inChart);
            foreach (KeyValuePair<string, Dictionary<string, string>> s in sqs)
            {
                InChart.InChartEntity ice = new InChart.InChartEntity();
                ice.ChartType = (s.Value.ContainsKey("ChartType") ? s.Value["ChartType"].ToString().Trim() : "");
                ice.Field_X = (s.Value.ContainsKey("Field_X") ? s.Value["Field_X"].ToString().Trim() : "");
                ice.Field_Y = (s.Value.ContainsKey("Field_Y") ? s.Value["Field_Y"].ToString().Trim() : "");
                ice.Caption_X = (s.Value.ContainsKey("Caption_X") ? s.Value["Caption_X"].ToString().Trim() : "");
                ice.Caption_Y = (s.Value.ContainsKey("Caption_Y") ? s.Value["Caption_Y"].ToString().Trim() : "");
                ice.ToolBox = (s.Value.ContainsKey("ToolBox") ? s.Value["ToolBox"].ToString() : "0");
                ice.HomePage = (s.Value.ContainsKey("HomePage") ? s.Value["HomePage"].ToString() : "0");
                ice.OnlyShowMe = (s.Value.ContainsKey("OnlyShowMe") ? s.Value["OnlyShowMe"].ToString() : "0");
                ice.VisibleItem = (s.Value.ContainsKey("VisibleItem") ? s.Value["VisibleItem"].ToString() : "0");
                this._SciptObject.Add(s.Key, ice);
            }
        }
    }
}
